package com.vcc.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.vcc.data.entity.WebhookSourceMessage;
import com.vcc.data.mapper.WebhookSourceMessageMapper;
import com.vcc.service.service.WebhookSourceMessageService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WebhookSourceMessageServiceImpl extends ServiceImpl<WebhookSourceMessageMapper, WebhookSourceMessage> implements WebhookSourceMessageService {

    @Override
    public Boolean existsByTransactionId(String transactionId) {
        return queryChain()
                .eq(WebhookSourceMessage::getTransactionId, transactionId)
                .exists();
    }

    @Override
    public List<WebhookSourceMessage> getByTransactionId(String transactionId) {
        return queryChain().eq(WebhookSourceMessage::getTransactionId, transactionId).list();
    }
}
